home *** CD-ROM | disk | FTP | other *** search
- /****
- * CNeoMetaClass.h
- *
- * Methods for the metaclass class.
- *
- * Copyright © 1992-1994 NeoLogic Systems. All rights reserved.
- *
- ****/
- #pragma once /* Include this file only once */
- #ifndef __CNeoMetaClass__
- #define __CNeoMetaClass__ 1
-
- #include "NeoTypes.h"
-
- class CNeoPersist;
-
- #if defined(qNeoPersist) && !defined(qNeoPersistPlusPlus)
- enum {kNeoClasses = 25}; // Total number of persistent classes in the application. NeoAccess uses 20 of these internally.
- #else
- enum {kNeoClasses = 100}; // Total number of persistent classes in the application. NeoAccess uses 20 of these internally.
- #endif
- typedef CNeoMetaClass * NeoMetaTable[kNeoClasses];
-
- // "method" for creating an object of this class
- typedef CNeoPersist * NeoGetOne(void);
-
- typedef void * NeoKeyManager(const NeoKeyOp aOp, ...);
-
- class CNeoMetaClass
- {
- public:
- /** Instance Methods **/
- CNeoMetaClass(const NeoID aID, const NeoID aSuper, const CNeoString &aName, NeoGetOne aGetOne = nil, NeoKeyManager aKeyManager = nil);
- virtual ~CNeoMetaClass(void);
-
- /** Class Methods **/
- static void AddMetaClass(CNeoMetaClass *aMetaClass);
- static CNeoMetaClass *
- FindByName(const CNeoString &aName);
- static CNeoMetaClass *
- GetMetaClass(const NeoID aClassID);
- NeoID getID(void) const {return fID;}
-
- /** Access Methods **/
- NeoID getIndexBase(const short aIndex) const {return fIndexBase[aIndex];}
- NeoID getIndexClass(const short aIndex) const {return fIndexClass[aIndex];}
- void getIndexClasses(NeoID *aClasses) const;
- void getName(CNeoString &aName) const {aName = fName;}
- char * getNamePtr(void) const;
- NeoID getSuperID(const short aIndex) const;
- short getSuperCount(void) const {return fSuperCount;}
- void setGetOne(NeoGetOne aMethod) {getOne = aMethod;}
- void setKeyManager(NeoKeyManager aMethod);
- void setSuperclass(const NeoID aClassID);
- #ifdef qPPCC
- NeoGetOne *getOne; // "method" for creating an object of this class
- NeoKeyManager *keyManager; // "method" for managing selection criteria for index classes
- #else
- NeoGetOne (*getOne); // "method" for creating an object of this class
- NeoKeyManager (*keyManager); // "method" for managing selection criteria for index classes
- #endif
-
- protected:
- short fIndexCount; // number of indexes this class has
- short fSuperCount; // number of superclasses this class has
- NeoID fID; // class id of this class
- NeoID fSuperID[kNeoMaxSuper]; // class IDs of this class's super classes
- CNeoString fName; // name of this class
- NeoID fIndexClass[kNeoMaxIndice]; // array of index classes
- NeoID fIndexBase[kNeoMaxIndice]; // root class which index is to be attached to
-
- public:
- static NeoID FSysClassID;
- static NeoID FObjClassID;
- static NeoMetaTable FMetaClass;
- };
- #endif
-